<template>
  <div class="header2">
    <!-- 封装组件 插槽 -->
    <div class="left" v-if="allLeft" @click="jumpLeft">
        <van-icon :name="icon" />
        <span v-if="leftFlag">返回</span>
    </div>
    <div class="right"></div>
    <div class="title">{{title}}</div>
  </div>
</template>
           
<script>
export default {
  props: {
    title: {
      type: String,
      default: "title333"
    },
    icon: {
        type:String,
        default:'arrow-left'
    },
    leftFlag: {
        type:Boolean,
        default:true
    },
    allLeft: {
        type:Boolean,
        default:true
    }
  },
   data() {
      return {};
    },
    methods:{
       jumpLeft() {
           this.$emit('arrowLeft')
       } 
    }

};
</script>
<style scoped lang="less">
.header2 {
  .left {
    float: left;
  }
  .title {
    text-align: center;
  }
  .right {
    float: right;
  }
}
</style>